import { get, post, put, del } from './request'

// 用户相关接口
export const userApi = {
  // 获取用户、抽奖
  getUserInfo: (code) => post(`/apis/user/ssoAuth?code=${code}`),
  checkStatus: (uid) => post(`/apis/user/checkIsMember?uid=${uid}`),
  checkActivityTime: (payload) => post(`/apis/user/checkActivityTime?uid=${payload.uid}`),
  checkAttendActivity: (payload) => post(`/apis/user/checkAttendActivity?uid=${payload.uid}`),
  startAttendActivity: (payload) => post(`/apis/user/startAttendActivity?uid=${payload.uid}`),
  saveEvaluate: (payload) => post(`/apis/user/saveEvaluate?uid=${payload.uid}&id=${payload.id}`, payload.evaluate),
  checkQrCode: (payload) => post(`/apis/user/checkQrCode?uid=${payload.uid}&checkCode=${payload.code}`, payload),
  doCheck: (payload) => post(`/apis/user/doCheck`, payload),
}

// 商户列表详情、产品相
export const festivalApi = {
  getCompanyList: (payload) => post(`/apis/user/getCompanyList?uid=${payload.uid}&pageNum=1&pageSize=10000`),
  getCompanyDetail: (payload) => post(`/apis/user/getCompanyDetail?uid=${payload.uid}&companyid=${payload.companyid}&pageNum=1&pageSize=10000`),
  getProductList: (payload) => post(`/apis/user/getProductList?uid=${payload.uid}&companyid=${payload.companyid}&pageNum=1&pageSize=10000`),
}

// 用户优惠券
export const couponApi = {
  getCouponList: (payload) => post(`/apis/user/myWinrecordList?uid=${payload.uid}&useType=${payload.useType}&pageNum=1&pageSize=10000`),
  getCouponDetail: (payload) => post(`/apis/user/getWinrecordDetail?uid=${payload.uid}&id=${payload.id}`),
  //  生成二维码
  generateQrCode: (payload) => post(`/apis/user/generateQrCode`, payload),
}

// 商家
export const merchantApi = {
  getRecordList: (payload) => post(`/apis/user/myCheckRecordList?uid=${payload.uid}&pageNum=1&pageSize=10000`),

}

export const statisticsApi = {
  getDashboard: (payload) => post(`/apis/user/dashboard?uid=${payload.uid}`),
  getChart: (payload) => post(`/apis/user/statisChart?uid=${payload.uid}`),
}